#!/bin/bash

# 设置Ascend环境变量
ASCEND_HOME_DIR=/usr/local/Ascend/ascend-toolkit/latest
export DDK_PATH=$ASCEND_HOME_DIR

# 创建build目录并编译
mkdir -p build
cd build
cmake ..
make
cd ..

# 参数：<kernel_name> <soc_version> <core_type> <run_mode>
# 这里核名应该是 multiply_custom
if [ $# -lt 1 ]; then
  echo "Usage: bash run.sh [soc_version] [core_type] [run_mode]"
  echo "Example: bash run.sh ascend910 AiCore cpu"
  exit 1
fi

# 执行可执行文件
./build/multiply_custom_exe $1 $2 $3
